package com.aspire.aimini.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 素材标签关联实体类
 *
 * @author wangguiyou
 * @date 2024-01-01
 * @description 存储素材和标签关联关系的实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("material_tags")
public class MaterialTag implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 素材ID
     */
    @TableField("material_id")
    private Long materialId;

    /**
     * 标签ID
     */
    @TableField("tag_id")
    private Long tagId;

    /**
     * 标签来源(manual/ai)
     */
    @TableField("source")
    private String source;

    /**
     * 置信度(AI识别时使用)
     */
    @TableField("confidence")
    private Double confidence;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;
}